package com.cgwx.systemservice.controller;

import com.cgwx.springsecurity.service.UserDetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.*;

/**
 * @author GaoWei
 * @Date 2023/10/28 - 11:41
 */

@Api(tags = "用户具体信息调用控制器")
@RestController
@RequestMapping("/system/userDetails")
@CrossOrigin
public class UserDetailsController {

    @Autowired
    private UserDetailsService userDetailsService;

    @ApiOperation("操作日志记录")
    @PostMapping("saveSysLog")
    public UserDetails loadUserByUsername(
        @ApiParam(name = "username", value = "用户名")
        String username) {
        return userDetailsService.loadUserByUsername(username);
    }
}
